package cn.sportvip.entity.user;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;

import cn.sportvip.Sport.Gender;
import cn.sportvip.entity.IdEntity;
/**
 * 用户验证信息，登陆时候用,邮箱登陆或者电话号码登陆
 * @author tao
 */
@Entity
@Table(name = "user_info")
public class UserInfo extends IdEntity {
	private static final long serialVersionUID = 1L;
	
	/**昵称*/
	@Column(name = "nick_name")
	private String nickName;
	/**头像*/
	private String avatar;
	/**生日*/
	private long birthday;
	/**性别*/
	private Gender gender = Gender.NOT_INPUT;
	
	@OneToOne(mappedBy = "userInfo", fetch = FetchType.LAZY)
	@JSONField(serialize = false)
	private Credential credential;

	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	public String getAvatar() {
		return avatar;
	}
	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}
	public long getBirthday() {
		return birthday;
	}
	public void setBirthday(long birthday) {
		this.birthday = birthday;
	}
	public Gender getGender() {
		return gender;
	}
	public void setGender(Gender gender) {
		this.gender = gender;
	}
	public Credential getCredential() {
		return credential;
	}
	public void setCredential(Credential credential) {
		this.credential = credential;
	}
}
